{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 判断闰年，输出True或False\n",
    "year = int(input())\n",
    "\n",
    "if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):\n",
    "    print('True')\n",
    "else:\n",
    "    print('False')\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2. 修改程序\n",
    "x = input()\n",
    "y = input()\n",
    "if (x == y):\n",
    "    print(\"两数相同！\")\n",
    "elif (float(x) > float(y)):\n",
    "    print(\"较大数为：\", x)\n",
    "else:\n",
    "    print(\"较大数为：\", y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 3. 个人所得税计算\n",
    "s = float(input())\n",
    "if s < 5000:\n",
    "    print('免税')\n",
    "else:\n",
    "    salary = s - 5000\n",
    "    if salary <= 3000:\n",
    "        fee, num = 3, 0\n",
    "    elif 3000 < salary <= 12000:\n",
    "        fee, num = 10, 210\n",
    "    elif 12000 < salary <= 25000:\n",
    "        fee, num = 20, 1410\n",
    "    elif 25000 < salary <= 35000:\n",
    "        fee, num = 25, 2660\n",
    "    elif 35000 < salary <= 55000:\n",
    "        fee, num = 30, 4410\n",
    "    elif 55000 < salary <= 80000:\n",
    "        fee, num = 35, 7160\n",
    "    else:\n",
    "        fee, num = 45, 15160\n",
    "\n",
    "    tax = salary * fee / 100 - num\n",
    "    print(\"应缴税款{:.2f}元，实发工资{:.2f}元。\".format(tax,salary + 5000 - tax))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 4. 判断登录成功失败\n",
    "username = str(input())\n",
    "password = str(input())\n",
    "\n",
    "if (username == 'admin') and (password == '123456'):\n",
    "    print('登录成功')\n",
    "else:\n",
    "    print('登录失败')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 5. 成绩判定\n",
    "#用户输入百分制的学生成绩，成绩大于或等于90的判定为“优秀”，大于等于80小于90判定为“良好”，大于等于70小于80判定为“合格”，否则为“不合格”\n",
    "#用于初学，不考虑异常数据\n",
    "\n",
    "score = eval(input())\n",
    "if score >= 90:\n",
    "    print('优秀')\n",
    "elif score >= 80:\n",
    "    print('良好')\n",
    "elif score >= 70:\n",
    "    print('合格')\n",
    "else:\n",
    "    print('不合格')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 6. BMI计算\n",
    "# 一行两个输入，自定义分隔符逗号\n",
    "weight, height = input().split(',')\n",
    "\n",
    "BMI = weight / (height ** 2)\n",
    "print('BMI数值为:{:.2f}'.format(BMI))\n",
    "\n",
    "# 判定值：18.5 24 25 28 30\n",
    "if BMI < 18.5:\n",
    "    print('BMI指标为:国际\\'偏瘦\\',国内\\'偏瘦\\'')\n",
    "elif BMI <24:\n",
    "    print('BMI指标为:国际\\'正常\\',国内\\'正常\\'')\n",
    "elif BMI <25:\n",
    "    print('BMI指标为:国际\\'正常\\',国内\\'偏胖\\'')\n",
    "elif BMI <28:\n",
    "    print('BMI指标为:国际\\'偏胖\\',国内\\'偏胖\\'')\n",
    "elif BMI <30:\n",
    "    print('BMI指标为:国际\\'偏胖\\',国内\\'肥胖\\'')\n",
    "else:\n",
    "    print('BMI指标为:国际\\'肥胖\\',国内\\'肥胖\\'')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
